<?php
////////////////////////////////////////////////////////////////////////////////
//   Copyright (C) ReloadCMS Development Team                                 //
//   http://reloadcms.sf.net                                                  //
//                                                                            //
//   This program is distributed in the hope that it will be useful,          //
//   but WITHOUT ANY WARRANTY, without even the implied warranty of           //
//   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.                     //
//                                                                            //
//   This product released under GNU General Public License v2                //
////////////////////////////////////////////////////////////////////////////////
$banners_path=DATA_PATH.'banners/';


function show_banner($id)
{
global $banners_path;
$result=file_get_contents($banners_path.$id);
return($result);
}

function get_banner_count()
{
global $banners_path;
$bbns=rcms_scandir($banners_path);
$bbns_count=count($bbns);
return($bbns_count);
}

show_window(__('Banners'), show_banner(rand(1,get_banner_count())) ,'center');
?>
